﻿package org.atk.components.treegridview 
{
	
	/**
	 * ...
	 * @author AeTky
	 */
	public class TreeGridViewItem{
		private var data:ITreeGridViewRowData = null;
		private var state:int = 0;
		private var childs:Array = new Array();
		private var isOpen:Boolean = false;
		private var isFolder:Boolean = false;
		
		public function TreeGridViewItem(data:ITreeGridViewRowData, isFolder:Boolean=false, isOpen:Boolean=false){
			this.data = data;
			this.isFolder = isFolder;
			this.isOpen = isOpen;
		}
		
		public function get Data():ITreeGridViewRowData { return data; }
		
		public function set Data(value:ITreeGridViewRowData):void {
			data = value;
		}
		
		public function get State():int { return state; }
		
		public function set State(value:int):void {
			state = value;
		}
		
		public function get Childs():Array { return childs; }
		public function get ChildCount():int { return childs.length; }
		
		public function get IsOpen():Boolean { return isOpen; }
		
		public function set IsOpen(value:Boolean):void {
			isOpen = value;
		}
		
		public function get IsFolder():Boolean { return isFolder; }
		
		public function set IsFolder(value:Boolean):void {
			isFolder = value;
		}
		
		public function append(item:TreeGridViewItem):void {
			childs.push(item);
		}
	}
	
}